<!--  -->
<template>
  <div>pina
    {{title }}

    <div>
      {{ user.name }}
    </div>
<!-- 
    {{ userStore.formatTitle }} -->
 


    <button @click="update">修改pinia</button>
    <RouterLink to="/pinia2">跳转</RouterLink>
  </div>
</template>

<script lang='ts' setup>
 
import { reactive,toRefs,ref,onMounted} from 'vue'
import {useDemoStore} from '../../store/index'
import { storeToRefs } from 'pinia';
 
const userStore= useDemoStore();
 


let {user,title}=storeToRefs(userStore);

// console.log(user.name);


const update=()=>{

  user.value.name="李四";
  title.value="您好"
   
    // userStore.updataTitle("qqqq");
}


</script>
<style scoped>
</style>